UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '26LbDveN1AIxAbJBw51XtrzM3s52YkaqdQ5rm/KgzII=' 
WHERE 
  key_id = '1a18669a49676e1744eb10528ea89c9bae881ca4a0c49b6b8943271b520f7f80' 
  AND (
    token = '26LbDveN1AIxAbJBw51XtrzM3s52YkaqdQ5rm/KgzII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033