UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4bPzZQQa4V/p5sCHPvfAj6Ov42aayzy8jMap8nnzrAg=' 
WHERE 
  key_id = 'f2232e351abeeb98c87761ef960dc9d61d083eb08075f74aca47979ec87b4f90' 
  AND (
    token = '4bPzZQQa4V/p5sCHPvfAj6Ov42aayzy8jMap8nnzrAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025