UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fB9QQIbqJ4SpVG9eNw/0nvJFLlzHqk+pakPuc3TZOUY=' 
WHERE 
  key_id = '932b5820f325ead7750d806eaf776f3efdabab763f1394ff72f83fcfbcf13bf4' 
  AND (
    token = 'fB9QQIbqJ4SpVG9eNw/0nvJFLlzHqk+pakPuc3TZOUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025