UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sbA5isg+gn8u/VfYsgB4npXjNlp6F82b0pMFjRA/Bhc='
WHERE
key_id = '0a13fa4d83673ed25ce618f98c60f2b3d2beee2328b115f71c66118d451ced5d'
AND (
token = 'sbA5isg+gn8u/VfYsgB4npXjNlp6F82b0pMFjRA/Bhc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)