UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UB+0+SNMUNyXZpYC7EuQz+tkpwTQvjS8cJUB55MnJvQ='
WHERE
key_id = '34697824a1406d351b709e1a4d9e5f03d95e0b99c0dd7a0e877b24edac4bd9a9'
AND (
token = 'UB+0+SNMUNyXZpYC7EuQz+tkpwTQvjS8cJUB55MnJvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)