UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nj9cxSHFsy0M6SuMbDtKqVktlR3DM4b55Nxt21QYeLQ='
WHERE
key_id = '889ac63e55cf3d673ed74b3ad5b4dee3343474c3d299431ea1bec3f9dff6eb25'
AND (
token = 'nj9cxSHFsy0M6SuMbDtKqVktlR3DM4b55Nxt21QYeLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)