UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oYszrdk1I3xKMWs+WhLa9ZizRcOCNhzXGgiFXY1qRMU=' 
WHERE 
  key_id = 'df669989832b2340240fbe13578417b1d36d67db22cf79e2524719d62c99c88e' 
  AND (
    token = 'oYszrdk1I3xKMWs+WhLa9ZizRcOCNhzXGgiFXY1qRMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033