UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8WV0GPY17IgHMk/3AwQkv7ap8fD6xErUQnCz5CYSR34='
WHERE
key_id = '7ad4f5dbb91cc5ebd93a7d86ebacb214cbf817d70b6735a38345db7f670ba3de'
AND (
token = '8WV0GPY17IgHMk/3AwQkv7ap8fD6xErUQnCz5CYSR34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)