UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ARXGmOB2CGuOhYuV+bcACGoIquSVnJ2dBaR3W7bjy0=' 
WHERE 
  key_id = '5378bd280ec82d38ce4d0767969b614523c590b745b92e9fa20999d501023fc6' 
  AND (
    token = '0ARXGmOB2CGuOhYuV+bcACGoIquSVnJ2dBaR3W7bjy0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017