UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VcxfyOu7La0de1AhV2SmGtQMXPUd6U080CbWLObauEg=' 
WHERE 
  key_id = '14e2d2ead9d2d92afa28fe41ccee6ab3e141bb54cd0e0292225c0c5117660f64' 
  AND (
    token = 'VcxfyOu7La0de1AhV2SmGtQMXPUd6U080CbWLObauEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038