UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o92rzaW+PyGBY2f18GNXca7TLy9AUqEvlFKdF7q2iNo=' 
WHERE 
  key_id = 'd1c8d768c392873ecdf1b10daa96713462683bf6785cdd7f53645b162fa89667' 
  AND (
    token = 'o92rzaW+PyGBY2f18GNXca7TLy9AUqEvlFKdF7q2iNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015