UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NaaTN1Wmse00UCAjM0GH+PmlUnp3qLxft0ZBif/axSQ='
WHERE
key_id = '1670fc9dc24a8ba1c2b73b99376cfaaeef9f294a12609aa168416920475b6281'
AND (
token = 'NaaTN1Wmse00UCAjM0GH+PmlUnp3qLxft0ZBif/axSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)