UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LlelrzIiyWIlgFseAosGRDE1KWbZYc72s37O/Xr7eXw='
WHERE
key_id = '000cb8a72ffb8a5fdef96fd486206a50daf03e6cbdb4188d60034a7389140bfc'
AND (
token = 'LlelrzIiyWIlgFseAosGRDE1KWbZYc72s37O/Xr7eXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)