UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tHpRYvF+B9WK1KKqxuKEw4CPih3NtRGoY63YycOUSzI='
WHERE
key_id = 'f0c0b07f0f1e5613e8ac7f27b04ae61d3c8b126fbe86378d65d2b0d126fa5ec4'
AND (
token = 'tHpRYvF+B9WK1KKqxuKEw4CPih3NtRGoY63YycOUSzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)