UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aDxH9Hw/2G8zFlC2y99zFyl+EWwOx60YyY2BaVzaZak='
WHERE
key_id = '5a2194f2f77d12528ca54712cc52b00bd4d44b3dcceda0b666536eb1b2729929'
AND (
token = 'aDxH9Hw/2G8zFlC2y99zFyl+EWwOx60YyY2BaVzaZak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)