UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bzd192ob7LIpWxly5ULpE939KjxeAACgHvS8BksMFWk='
WHERE
key_id = '3f4cab7694636bc399a5baecc6572d0ed77abfb0d720d7a0cb84bcc699545184'
AND (
token = 'Bzd192ob7LIpWxly5ULpE939KjxeAACgHvS8BksMFWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)