UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PQ+N6V0aDLdmMSYGmA0QSJvx6MAOXztPpGGG2XUG9hM='
WHERE
key_id = '1635ed68a6409c889029b53da4ddbd8809828cb2c7557cbc73baf064a65d3f3d'
AND (
token = 'PQ+N6V0aDLdmMSYGmA0QSJvx6MAOXztPpGGG2XUG9hM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)