UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UHI/klEnJIow4abEUN6C3a1nd5YLgid0hwCSFdXQXBk='
WHERE
key_id = '7e0422b111b9f9603354185718c6ddf28b73d2cc866fd9faaaf28a1ac7cce272'
AND (
token = 'UHI/klEnJIow4abEUN6C3a1nd5YLgid0hwCSFdXQXBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)