UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e2ileQfEYuAMf95wsApSZ8bEFg9O9ytlpJXvKLqQsLM='
WHERE
key_id = '51def3e9fb332c2829c1b1c11f6a721c4a11d6fe5d071879e98b57ba9136fd30'
AND (
token = 'e2ileQfEYuAMf95wsApSZ8bEFg9O9ytlpJXvKLqQsLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)