UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4kUEHxbcC8IOxlAPuKJaOYbujPXszJMV4lDJVyH4buY='
WHERE
key_id = '7771b7378c7866b6e5dc0bf54da2a5886f4e214a6d880db0d4bba6d97f03e09d'
AND (
token = '4kUEHxbcC8IOxlAPuKJaOYbujPXszJMV4lDJVyH4buY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)