UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'REOR3tbpsx+wDgb2HRPc+VeOzyji4GVLJ3qSMYz19Tk='
WHERE
key_id = 'c5658f0be0bba051bcdb0914221594d4da171ab8710a7235b3c063d2918d5e28'
AND (
token = 'REOR3tbpsx+wDgb2HRPc+VeOzyji4GVLJ3qSMYz19Tk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)