UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YBZjfe5vAXZQ1GqVoTabWbDEiJZffN1mkI5m+WpZBS8='
WHERE
key_id = '14701287426b7cbe9ce2bdc16132703047a90081d005ce3ba49e3f4c06059dd5'
AND (
token = 'YBZjfe5vAXZQ1GqVoTabWbDEiJZffN1mkI5m+WpZBS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)