UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z6/Gm0qhdUcN+omWlPeCKXNtsmLw2U42Al/iYpkOrQc='
WHERE
key_id = '0ddd61e6e080c5b7036a56fb8e856517cb46ad0168ed71dd6d171cc203005c62'
AND (
token = 'Z6/Gm0qhdUcN+omWlPeCKXNtsmLw2U42Al/iYpkOrQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)