UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tmpshJujEQ4mxu6agaRm3qZV37beobninETTfGF/i2Q='
WHERE
key_id = '2f3f79500d908982edc38525deb32cfe01fa828fc5f1d2dd797a83af65dc6c9c'
AND (
token = 'tmpshJujEQ4mxu6agaRm3qZV37beobninETTfGF/i2Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)