UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+bwOfN+6tGjXSD3KOhkHNkU3xY5pfLW1ruqTaI9Iz78='
WHERE
key_id = '2b6051f4f11694d21aac2874f5fae2f62c283e4a112ac26beac81717791e476a'
AND (
token = '+bwOfN+6tGjXSD3KOhkHNkU3xY5pfLW1ruqTaI9Iz78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)