UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oO6vPltUhJocBZWB3hsMF3aCMXFBiBCyNAWjNlXjLkc='
WHERE
key_id = '0920e42481e0c309355bfa90c4a0b12b09d0cca31bab0e60639e05eaddf081eb'
AND (
token = 'oO6vPltUhJocBZWB3hsMF3aCMXFBiBCyNAWjNlXjLkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)