UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '19Q8VPOtnvjjV/zacR17nyYOs01XXaqsjfBmrgZPz2k='
WHERE
key_id = 'd4da88371f3ac95310f9c63070943384f961c806523fbf3de0b5e437f347b40b'
AND (
token = '19Q8VPOtnvjjV/zacR17nyYOs01XXaqsjfBmrgZPz2k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)