UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8zdG15XyKucZF1+S8CkOKoOQqwXqFTipSPG2vPUkg2E=' 
WHERE 
  key_id = '90b1e76cb6188b8901a0f1235c7fc716adee645a9f30dabb01476525b0a1b9b4' 
  AND (
    token = '8zdG15XyKucZF1+S8CkOKoOQqwXqFTipSPG2vPUkg2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024