UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pkFLPHObQsaUHj04frA4gxPdscVQJ2OVOLLhiXI2O/U=' 
WHERE 
  key_id = '99f82ad1b115fce8add773399a0a51e65419e1e3b8f1092809178137d550dfea' 
  AND (
    token = 'pkFLPHObQsaUHj04frA4gxPdscVQJ2OVOLLhiXI2O/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056