UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k1H8N5gXdLG1tEbGUjxJwjdJU+wqrqXLS1BkCjaTOJc='
WHERE
key_id = 'dfdbd44808bc963cf80ba7618889d2365852945efef98b507c415562ca6a16e5'
AND (
token = 'k1H8N5gXdLG1tEbGUjxJwjdJU+wqrqXLS1BkCjaTOJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)