UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DE/OaLsU7GRbEId/lazV0IfAyqnMMvdkAHoScbIKNHQ='
WHERE
key_id = 'abcdfd23769b253126833868f11272d8fd8fd4975c513031a9375d1492a9a61a'
AND (
token = 'DE/OaLsU7GRbEId/lazV0IfAyqnMMvdkAHoScbIKNHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)