UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qvLnY7FkhuEsh4y8f2cRhpMqhUsM+u43KqBJNj0v9qI='
WHERE
key_id = '31d063d475780be99242b27d89a6c8d693e167db1b08a454e1785af1c47cea2b'
AND (
token = 'qvLnY7FkhuEsh4y8f2cRhpMqhUsM+u43KqBJNj0v9qI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)